package com.yssoft.controller.app.system;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yssoft.entity.core.TDdDetail;
import com.yssoft.service.core.DdDetailService;
import com.yssoft.utils.AppUtil;

/**
 * @author 王永宁
 * @说明 app获取数据字典
 * @time 2018/5/4 下午 06:57
 */
@CrossOrigin//解决跨域session问题
@Controller()
@RequestMapping("/app/ddDetail")
public class AppDdDetailController {

	@Resource
	private DdDetailService ddDetailService;
	
	  /**
     * APP获取数据字典
     * @author 王永宁
     */
    @RequestMapping(value = "getDdDetailList",method = RequestMethod.GET)
    @ResponseBody
    public Object getDdDetailList() {
        try {
        	 List<TDdDetail> list = ddDetailService.findAllByApp();
            return AppUtil.returnListObjectJson("1", "获取数据字典成功!", list);
        } catch (Exception e) {
            return AppUtil.returnMapJson("0", "获取数据字典失败!", null);
        }
    }
}
